package com.foxcai.novel.util;

import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;

public class CallHtml {

	public static void callOnePage(String fileName, String path,
			String realName, String realPath) {
		try {
			String str = "http://127.0.0.1:8080/novel/toHtmlPath?file_name="
					+ fileName + "&&path=" + path + "&&realName=" + realName
					+ "&&realPath=" + realPath;
			int httpResult;
			URL url = new URL(str);
			URLConnection connection = url.openConnection();
			connection.connect();
			HttpURLConnection httpURLConnection = (HttpURLConnection) connection;
			httpResult = httpURLConnection.getResponseCode();
			if (httpResult != HttpURLConnection.HTTP_OK) {
				System.out.println("没有连接成功");
			} else {
				System.out.println("连接成功了　");
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	public static void main(String[] args) {
		String fileName = "view.jsp?nid=2114779";
		String path = "";
		String realName = "";
		String realPath = "";
		
		callOnePage(fileName,path,realName,realPath);
	}
}
